﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using AAA.DesignPattern.Observer;

namespace AAA.Chart.Component
{
    public partial class ChartCross : UserControl//, IObserver 
    {
        private Color _CrossColor = Color.Black;
        private int _LineDirection = 0; //0, Hori 1, Vertical

        public int LineDirection
        {
            get { return _LineDirection; }
            set { _LineDirection = value; }
        }

        public Color CrossColor
        {
            get { return BackColor; }
            set { BackColor = value; }
        }

        public int CrossWidth
        {
            get
            {
                if (_LineDirection == 0) { return Width; }
                else { return Height; }
            }
            set {
                if (_LineDirection == 0) { Width = value; }
                else { Height = value; }            
            }
        }

        public ChartCross()
        {
            InitializeComponent();
            Init();
        }

        private void Init() {

        }

        private void ChartCross_MouseClick(object sender, MouseEventArgs e)
        {
                List<object> M_Pos = new List<object>();
                try
                {
                   /* M_Pos.Add(Parent.Name);
                    M_Pos.Add(e);
                    IMessageInfo miMessage = new MessageInfo();
                    miMessage.MessageTicks = DateTime.Now.Ticks;
                    miMessage.MessageSubject = "CrossClick";
                    miMessage.Message = M_Pos;
                    MessageSubject.Instance().Subject.Notify(miMessage);*/
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message + "," + ex.StackTrace);
                }
        }
    }
}
